<!--
 * @Author: HeAo
 * @Date: 2021-10-09 09:23:53
 * @LastEditTime: 2021-10-09 10:05:48
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \web2103-2105\web2105\3-2-Vue\day02\2-事件修饰符.html
 * 别乱动！
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../js/vue.js"></script>
  <style>
    .outer {
      width: 500px;
      height: 500px;
      background-color: seagreen;
      overflow: scroll;
    }

    .inner {
      width: 200px;
      height: 800px;
      background-color: slateblue;
      /* margin: 100px; */
    }
  </style>
</head>

<body>
  <div id="app">
    <input type="text" @keyup.enter="enterUpHandler" @mousedown.left="leftMousedownHandler">
    <a href="https://www.baidu.com" @click.prevent.once="toBaiduHandler">百度一下</a>
    <div class="outer" @click.capture="outerHandler" @scroll.passive="scrollHandler">
      outer
      <div class="inner" @click.capture="innerHandler">
        inner
      </div>
    </div>
  </div>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {

      },
      methods: {
        outerHandler(event) {
          console.log('outer', event.target, event.currentTarget);
        },
        innerHandler(event) {
          // event.stopPropagation()
          console.log('inner', event.target, event.currentTarget);
        },
        toBaiduHandler() {
          console.log('百度一下');
        },
        scrollHandler() {
          console.log('页面滚动');
        },
        enterUpHandler(event) {
          console.log(event.target.value);
        },
        leftMousedownHandler() {
          console.log('鼠标左键按下');
        }
      },
      created() {

      }
    })
  </script>
</body>

</html>